Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow v1/v2 independent import of torchvision.transforms #1717

Merged
merged 5 commits into from
Nov 6, 2024

Conversation

liopeer
Copy link
Contributor

@liopeer liopeer commented Nov 5, 2024

Changes

  • adds file lightly/transforms/torchvision_transforms.py with:
    • import v2 of torchvision.transforms if available, else keep using v1
    • add ToTensor() transform that is compatible with v2
  • make transforms (irrespective of v1 or v2) available in module lightly.transforms as lightly.transforms.torchvision_transforms

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.88%. Comparing base (fb70eaa) to head (4f3795c).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
lightly/transforms/torchvision_transforms.py 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1717      +/-   ##
==========================================
- Coverage   84.90%   84.88%   -0.03%     
==========================================
  Files         156      157       +1     
  Lines        6526     6537      +11     
==========================================
+ Hits         5541     5549       +8     
- Misses        985      988       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@guarin guarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🎉

@liopeer liopeer merged commit c22ee83 into master Nov 6, 2024
13 of 14 checks passed
@liopeer liopeer deleted the lionel-lig-5621-add-torchvision-v2-transforms branch November 6, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants